/// single 单选  multiple 多选 range 区间
enum HcCalendarSelectMode { single, multiple, range }

enum MonthType { pre, current, next }

enum HcCalendarDayStatus { selected, start, end, middle, disabled, normal }

class HcCalendarDay {
  //当前日期
  DateTime _day;

  //当前的类型
  HcCalendarDayStatus _dayStatus = HcCalendarDayStatus.normal;

  //当前的文字
  String? _text;

  //顶部文字
  String? _topText;

  //底部文字
  String? _bottomText;

  //月份类型
  MonthType _monthType;

  String get text => _text ?? '';

  set text(String value) {
    _text = value;
  }

  DateTime get day => _day;

  set day(DateTime value) {
    _day = value;
  }

  set dayStatus(value) {
    _dayStatus = value;
  }

  get dayStatus => _dayStatus;

  HcCalendarDay(
      {required day,
      monthType = MonthType.current,
      dayStatus = HcCalendarDayStatus.normal,
      text = "",
      topText = "",
      bottomText = ""})
      : _dayStatus = dayStatus,
        _monthType = monthType,
        _text = text,
        _topText = topText,
        _bottomText = bottomText,
        _day = day;

  String get topText => _topText ?? '';

  MonthType get monthType => _monthType;

  set topText(String value) {
    _topText = value;
  }

  String get bottomText => _bottomText ?? '';

  set bottomText(String value) {
    _bottomText = value;
  }

  assign({day, monthType, dayStatus, text, topText, bottomText}) {
    _day = day ?? _day;
    _dayStatus = dayStatus ?? _dayStatus;
    _text = text ?? _text;
    _topText = topText ?? _topText;
    _bottomText = bottomText ?? _bottomText;
  }

  @override
  String toString() {
    return 'HcCalendarDay{day: $_day, dayType: $_dayStatus, text: $_text, topText: $_topText, bottomText: $_bottomText, monthType: $_monthType}';
  }
}

//返回的结果值
class HcCalendarSelectResult {
  //点击类型
  final HcCalendarSelectMode mode;

  //结果列表
  final List<DateTime> resultList;

  HcCalendarSelectResult({required this.mode, required this.resultList});

  @override
  String toString() {
    return 'HcCalendarSelectResult{type: $mode, resultList: $resultList}';
  }
}
